home *** CD-ROM | disk | FTP | other *** search
Wrap
/* AREXX Script for MPEG-Soundplaying Layer 2&3 Opus5.5+ Filetypes ** Displays Song, MPEG-Layer, Playtime in a Dopus Progress Window ** (or Melody MPEGPlay Window). ** ** Needed: Directory Opus V5.5+ (© by Jonathan Potter & GPSoftware) ** mpega >= V3.0 (© 1995-97 by Stephane Tavenard) ** ** Optional: ** Melody MPEG-Soundcard (© 1997 KATO) ** MPEGPlay by Thorsten Hansen V1.0+ ** PeggyPlus MPEG-Card (© Ingenierbuero Helfrich) ** Toccata, Prelude, Delfina-Soundcard & other Soundcard with AHI-Driver ** AHI Retargetable Audio System (© by Martin Blom) ** ** ** $VER: PlayMP2.dopus5 2.0 ** Copyright © 1995-1997 Eckhard Ludwig (Eckhard@top.east.de) ** ** EmailWare: ** This program is Email-Ware ! ** ** Installation: ** As Opus 5 Filetypes ** Call as Filetype MPEG-Sound Layer2 (Layer3, only MPEGA): ** -------------------------------------------------------------------------- ** (Doubleklick) ARexx DOpus5:ARexx/PlayMP2.dopus5 {f} {Qp} {Ql} ** -------------------------------------------------------------------------- ** Set flags: "Run asynchron" (Asynchroner Start) ** ** Usage: ** Doubleclick to .mp2/3 file and start MPEG-play. ** if you want to abort a sound press the abort button. ** ** Deutsch: ** Programm: PlayMP2.dopus5, Universeller Opus5 MPEG Audioplayer (Layer 2&3), ** unterstützt MPEG-Karten (Layer 2, Melody Layer2+3), Soundkarten (AHI), ** Amigasound (Setup über "Player-Setup" !). ** ** Doppelklicke ein .mp2/3 File, MPEG-Wiedergabe wird gestartet. ** Wenn anderer Titel oder MPEGPlayer (PlayerMP2.dopus5, PlayMP2.rexx, ** PlayerMP2.rexx) gerade läuft, wird dieser zuvor sofort beendet. ** Erneuter Aufruf startet sofort den nächsten Titel (beendet zuvor alten). */ /*--------S E T T I N G S : ------------------------------------------- ** If the file ENV:PlayMP2.prefs exists, that one will override the ** settings here ! */ /* Auswahl Player: AUTO Auto MELODY Melody Soundcard PEGGYMELODY PeggyPlus Card with Melody MPEG-Player CD32 CD32 FMV-Modul with Melody MPEG-Player (not tested!) PEGGYPLAYER PeggyPlus Default MPEG-Player MPEGA Softwareplayer */ Player = "AUTO" PlayMPEG = "C:mpega" /* Path Softwareplayer */ PlayMelody = "C:MPEGPlay" /* Path Melody Hardwareplayer */ MPEGA_OPTIONS="-p0 -T -f0 -d2 -q2" /* MPEGA Optionen, Vorgabe: Amiga Paula */ BREAKMPEG = "C:BreakName" /* Path MPEGA Breaktool */ parse arg '"'Titel'"' portname handle if portname='' then portname='DOPUS.1' If ~SHOW("P",portname) THEN DO SAY portname' is not a valid port!' exit end Signal on syntax options results options failat 21 lf='0a'x address value portname dopus version if ( result='RESULT' | TRANSLATE(result,'.',' ') < 5.1218 ) THEN DO dopus request '"This script requires DOpus V5.5 or greater." OK' exit end if open(1,'env:PlayerMP2.prefs','R') then do do i=1 to 6 prefs.i = readln(1) end if prefs.2 ~="" then PlayMelody=prefs.2 if prefs.3 ~="" then PlayMPEG=prefs.3 if prefs.4 ~="" then BREAKMPEG=prefs.4 if prefs.5 ~="" then MPEGA_OPTIONS=prefs.5 if prefs.6 ~="" then Player=prefs.6 drop prefs. call close(1) end if ~show('l','rexxsupport.library') then call addlib('rexxsupport.library',0,-30,0) /* init locale */ if ~show(l,'locale.library') then call addlib('locale.library',0,-30) if show(l,'locale.library') then catalog=opencatalog('PlayMP2.catalog','english',0) If Player="AUTO" then do SELECT WHEN exists("DEVS:melodympeg.device")&exists(PlayMelody) then Player="MELODY" WHEN exists("DEVS:peggympeg.device")&exists(PlayMelody) then Player="PEGGYMELODY" WHEN exists("DEVS:mpeg.device")&exists(PlayMelody) then Player="CD32" WHEN exists("DEVS:peggympeg.device")&showlist("A","PEGGYPLUS")=1 then Player="PEGGYPLAYER" OTHERWISE Player="MPEGA" END end dopus getfiletype '"'Titel'"' id DT=result /* Player starten & testen */ If DT="MP3"|Player="MPEGA" then do if ~exists(PlayMPEG) then do ADDRESS VALUE portname dopus front dopus request '"'getcatstr(9,'Fatal Error ...'lf''lf'MPEGA by Stephane TAVENARD not found !'lf'path to command: '"'%s'"'',PlayMPEG)'"' getcatstr(1,'Quit') exit end if ~exists(BREAKMPEG) then do ADDRESS VALUE portname dopus front dopus request '"'getcatstr(10,'Error ...'lf''lf'Breaktool by Kai Iske not found !'lf'path to command: '"'%s'"'',BREAKMPEG)'"' getcatstr(6,'OK') end if Player="PEGGYPLAYER" & show('P','Peggy') then address 'Peggy' QUIT If (Player="MELODY"|Player="PEGGYMELODY"|Player="CD32") & show('P','MPEGPLAY.1') then address 'MPEGPLAY.1' 'QUIT' end address command BREAKMPEG" "PlayMPEG" C" if DT="MP2" then do if Player="MELODY" & exists(PlayMelody) & ~show('P','MPEGPLAY.1') then do call pragma('STACK',10000) address command 'run >NIL: <NIL: 'PlayMelody' DEV=melodympeg.device BUFF=32000 NBUFF=10 PUBSCREEN='portname 'waitforport MPEGPLAY.1' end if Player="PEGGYMELODY" & exists(PlayMelody) & ~show('P','MPEGPLAY.1') then do call pragma('STACK',10000) address command 'run >NIL: <NIL: 'PlayMelody' DEV=peggympeg.device BUFF=5000 NBUFF=20 PUBSCREEN='portname 'waitforport MPEGPLAY.1' end if Player="CD32" & exists(PlayMelody) & ~show('P','MPEGPLAY.1') then do call pragma('STACK',10000) address command 'run >NIL: <NIL: 'PlayMelody' DEV=mpeg.device BUFF=32000 NBUFF=10 PUBSCREEN='portname 'waitforport MPEGPLAY.1' end if Player="PEGGYPLAYER" then do if showlist("A","PEGGYPLUS")=1 & ~show('P','Peggy') then do call pragma('STACK',8192) address command 'run >NIL: <NIL: PEGGYPLUS:MPEGPlayer' 'waitforport Peggy' DUMMY=Delay(10) end if ~show('P','Peggy') then do ADDRESS VALUE portname dopus front dopus request '"'getcatstr(8,'Fatal Error ...'lf''lf'Peggy-Plus MPEG Player not found !'lf'Please run Peggy-Player first.')'"' getcatstr(1,'Quit') exit end end end If show('P','mpegport') then address 'mpegport' STOP DUMMY=delay(20) if DT="MP3"|Player="MPEGA" then do address command "RUN >NIL: "PlayMPEG" <nil: "MPEGA_OPTIONS" " '"'Titel'"' " >PIPE:MPEGAOUT" if ~Open('MPEGAOUT','PIPE:MPEGAOUT','r') then do ADDRESS VALUE portname dopus front dopus request '"'getcatstr(7,'System Error ...'lf'DEVS:DOSDrivers/PIPE not installed !')'"' getcatstr(1,'Quit') exit end Titel=substr(Titel,lastpos("/",Titel)+1) MPEGAV = readln('MPEGAOUT') parse var MPEGAV MPEGAV "(C)" ADDRESS VALUE portname LISTER SET Handle newprogress name info bar abort do until readln('MPEGAOUT')="" end BUFFER="" DUMMY="" DO UNTIL DUMMY='0D'x DUMMY=readch('MPEGAOUT',1) BUFFER=BUFFER||DUMMY end PM=substr(BUFFER,1,2) PS=substr(BUFFER,4,2) TIME=PM*60+PS SEC=0 LISTER SET Handle newprogress title substr(BUFFER,1,6)||MPEGAV LISTER SET Handle newprogress name substr(BUFFER,11,29) DO UNTIL Eof('MPEGAOUT') COUNT=ReadCh('MPEGAOUT',6) LISTER SET Handle NEWPROGRESS INFO PM":"PS" "Titel LISTER SET Handle NEWPROGRESS bar TIME SEC SEC=SEC+1 PS=right(PS-1,2,0) if PS<0 then do PS=59 PM=right(PM-1,2,0) end LISTER QUERY Handle abort IF RESULT THEN address command BREAKMPEG" "PlayMPEG" C" end LISTER CLEAR Handle progress DUMMY=delay(10) CALL Close('MPEGAOUT') end If DT="MP2" & Player="PEGGYPLAYER" then do address 'Peggy' open '"'Titel'"' setwindow XOFF 0 YOFF 0 WIDTH 1 HEIGHT 1 XPIC 0 YPIC 0 Play async end if DT="MP2" & (Player="MELODY"|Player="PEGGYMELODY"|Player="CD32") then do if ~show('P','MPEGPLAY.1') then do ADDRESS VALUE portname dopus front dopus request '"'getcatstr(11,'Fatal Error ...'lf''lf'MPEGPlay V1.0+ by Thorsten Hansen not found !'lf'Path to Command: '"'%s'"''lf'For Setup use Player-Setup !',PlayMelody)'"' getcatstr(1,'Quit') exit end else do address 'MPEGPLAY.1' 'showgui' 'play' Titel end end exit /*-----Locale-----------------------------------------------------------------*/ getcatstr: parse arg msgno,msgstring,insert.1,insert.2 if catalog~=0 then msgstring=getcatalogstr(catalog,msgno,msgstring) j=0 do while pos('%s',msgstring)>0 parse var msgstring fore '%s' aft j=j+1 msgstring=fore||insert.j||aft end return msgstring